import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import WindiCSS from 'vite-plugin-windicss'
import AutoImport from 'unplugin-auto-import/vite';
import Components from 'unplugin-vue-components/vite';
import { VantResolver } from '@vant/auto-import-resolver';
import path from 'path';
import dns from "dns"
dns.setDefaultResultOrder("verbatim")


// https://vite.dev/config/
export default defineConfig({
  // server: {
  //   host: 'localhost',
  //   port: 8080,
  //   proxy: {
  //     '/req': {
  //       target: 'http://localhost:8080',
  //       rewrite: path => path.replace(/^\/req/, ''),
  //       changeOrigin: true,
  //       secure: false
  //     }
  //   }
  // },
  plugins: [
    vue(), WindiCSS(),
    AutoImport({
      resolvers: [VantResolver()],
    }),
    Components({
      resolvers: [VantResolver()],
    }),
  ],
  resolve: {
    alias: {
      '@': path.resolve(__dirname, './src'),
    },
  },



});